package com.hyh.prize.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hyh.prize.entity.TabSaleplanGiftcode;
import com.hyh.prize.mapper.GiftMapper;
import com.hyh.prize.service.GiftService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GiftServiceImpl extends ServiceImpl<GiftMapper,TabSaleplanGiftcode> implements GiftService {

    //根据礼品编号查询礼品信息
    public TabSaleplanGiftcode getGift(String code){
        QueryWrapper<TabSaleplanGiftcode> queryWrapper=new QueryWrapper();
        queryWrapper.eq("GIFTCODE",code);
        TabSaleplanGiftcode tabSaleplanGiftcode = getOne(queryWrapper);
        return tabSaleplanGiftcode;
    }

    //根据中奖等级查询礼品信息
    public List<TabSaleplanGiftcode> getGiftInfo(String leve){
        QueryWrapper<TabSaleplanGiftcode> queryWrapper=new QueryWrapper();
        queryWrapper.eq("PRIZELEVEL",leve);
        List<TabSaleplanGiftcode> list = this.list(queryWrapper);
        return list;
    }
}
